package com.cccyy.lottery;

import java.util.List;

public class TestLottery {
    public static void main(String[] args) {
        LotteryService lotteryService = new LotteryService();

        double probability = 0.3; // 假设中奖概率是30%
        boolean won = lotteryService.draw(probability);
        if (won) {
            String username = "User1"; // 假设用户名是User1
            lotteryService.addWinner(username);
            System.out.println(username + " 中了奖！");
        } else {
            System.out.println("未中奖。");
        }

        // 获取所有中奖用户
        List<String> winners = lotteryService.getWinners();
        for (String winner : winners) {
            System.out.println("中奖用户: " + winner);
        }
    }
}
